package com.hk.core.autoconfigure.web.servlet;

import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.web.servlet.HandlerInterceptor;


/**
 * @author kevin
 * @date 2019-12-19 14:38
 */
public class UserURIPermissionHandlerInterceptor implements HandlerInterceptor {

    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) {
//        var requestURI = request.getRequestURI();
//        if (SecurityContextUtils.isAuthenticated() && SecurityContextUtils.getPrincipal().hasPermission(requestURI)) {
//            return true;
//        }
//        Webs.writeJson(response, HttpServletResponse.SC_OK, JsonResult.forbidden(null));
//        return false;
        return true;
    }
}
